﻿using UnityEngine;
using System.Collections;
using UnityEngine;

public class SetActiveSettlement : MonoBehaviour {

	public PlayerStorage Main;
	public SettlementService settle;
	public int Destination;
	public float distance;
	public int CurrentSettlement;
	
	public GameObject obj_CurrentSettlement;
	public GameObject obj_DestinationSettlement;
	
	public void SetValues()
	{
		CurrentSettlement = PlayerPrefs.GetInt("ActiveSettlement");
		obj_CurrentSettlement = settle.Settlements[CurrentSettlement];
		obj_DestinationSettlement = settle.Settlements[Destination];
		distance = Vector3.Distance(obj_CurrentSettlement.transform.position,obj_DestinationSettlement.transform.position)/2;  
		Main.ActiveSettlement = Destination;	
		PlayerPrefs.SetInt("ActiveSettlement", Destination);
		Main.distance = distance;
	}
	
	
	
	
}
